import Blockly from 'blockly/core'
import 'blockly/python_compressed'
import 'blockly/blockly_compressed'
import 'blockly/blocks_compressed'

Blockly.Blocks.is_judgement = {
  init: function () {
    this.appendValueInput('Is').setCheck(null).appendField('is')
    this.setOutput(true, null)
    this.setColour(230)
    this.setTooltip('')
    this.setHelpUrl('')
  }
}

Blockly.Python.is_judgement = function (block) {
  const contentBehindIs = Blockly.Python.valueToCode(
    block,
    'Is',
    Blockly.Python.ORDER_ATOMIC
  )
  const code = 'is' + contentBehindIs
  return [code, Blockly.Python.ORDER_NONE]
}

export default Blockly
